<?php

namespace yphp;

class Cmd
{
    private static $init;

    // 初始化应用配置
    static function init()
    {
        $dir = dir(YP . 'config' . DS);
        while (false !== ($path = $dir->read())) {
            if ($path === '.' || $path === '..') continue;
            $name = substr($path, 0, -4);
            DealFile::copy(YP . 'config' . DS . $name . '.php', CONFIG . $name . '.php');
        }
        $dir->close();
    }

    // 取得路由
    static function loadRoute()
    {
        DealFile::copy(YP . 'route.php', ROUTE . 'route.php');
    }
}